<?php
require "misc.php";
require_once "dataLogic/dataCenter.php";

log_action("In Page : ".__FILE__);

if(!isset($_SESSION)){session_start();}

ob_start(); // begin collecting output
include 'dataLogic/tasklist.php';
$taskList = ob_get_clean(); 

ob_start();
include 'dataLogic/taglist.php';
$tagList = ob_get_clean();

//unfinshed tasks count
$unfinishedCount = GetUserTasksInfo()->Count();

$taskContents =<<< EOTaskContents
<div class="wrapper mt50">
	<div class="nav">
	<ul>
		<li class="tasks current">
			<span class="nav-item">Tasks</span><span class="count">$unfinishedCount</span>
			<div id="taglist">
				$tagList
			</div>
		</li>
		<li class="rewards">
			<a href="main2.php"><span class="nav-item">Rewards</span></a>
		</li>
	</ul>
	</div>
	<div id="content" class="content">
		<div class="add-task">
			<input type="text" id="task-name-main" value="Add a new task..." maxlength="50" />
			<input type="button" value="Add" class="green big" id="add" />
		</div>
		<div id="tasklist">
			$taskList
		</div>
		$addTaskContents
		$deleteTaskContents
		$editTaskContents
		<div class="success-message">A new task was added!</div>
		<input type='hidden' value='0' class='hide_current_id' />
	</div>
</div>

EOTaskContents;

echo $taskContents;

?>